/*
 * basics.h
 *
 *  Created on: 12.04.2011
 *      Author: gageik
 */

#ifndef BASICS_H_


#define PI    3.14159265358979323846f


void twi_debug_status(int status, int index);	// Get Debug Information about TWI

void renew_display(void);		// Refresh Data on Display


typedef struct {
	unsigned char stellwertM1; // Wertebereich: 0 bis 255
	unsigned char stellwertM2;	//
	unsigned char stellwertM3;
	unsigned char stellwertM4;
	float fehlerintegral_roll;
	float fehlerintegral_yaw;
	float fehlerintegral_pitch;
	float accelero_alt;

	float p_roll;
	float i_roll;
	float d_roll;

	float p_yaw;
	float i_yaw;
	float d_yaw;

	int integral_index;
} controllerDaten;

typedef struct {
	float gyro_x;
	float gyro_y;
	float gyro_z;
	float acc_x;
	float acc_y;
	float acc_z;

	float gyro_x_last;
	float gyro_y_last;
	float gyro_z_last;
	float acc_x_last;
	float acc_y_last;
	float acc_z_last;

	float gyro_x_bias;
	float gyro_y_bias;
	float gyro_z_bias;
	float acc_x_bias;
	float acc_y_bias;
	float acc_z_bias;

	float winkel_x;
	float winkel_y;
	float winkel_z;

	float sum_gyro_x;
	float sum_gyro_y;
	float sum_gyro_z;
} sensorDaten;

typedef struct {
	short gyro_x;
	short gyro_y;
	short gyro_z;
	short acc_x;
	short acc_y;
	short acc_z;
} sensorDaten_raw;

typedef struct {
	float gyro_x;
	float gyro_y;
	float gyro_z;
	float acc_x;
	float acc_y;
	float acc_z;
} sensorDaten_raw_float;

typedef struct {
	double q0;
	double q1;
	double q2;
	double q3;
} Quaternion ;

#define BASICS_H_
#endif /* BASICS_H_ */
